﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace ImageCalibModule
{
    public static  class ImageCalibManager
    {
        public static ImageCalibHandeye ImageCalibHandeye { get; set; }
        public static  void Init()
        {
            FrameManager.FrameManager.saveProject += FrameManager_saveProject;
            FrameManager.FrameManager.saveAsProject += FrameManager_saveAsProject;
            FrameManager.FrameManager.openProject += FrameManager_openProject;
            FrameManager.FrameManager.listImageCalibs=new List<ImageDefine.ImageCalibBase>();
            ImageCalibHandeye= ImageCalibHandeye.Load(Application.StartupPath + @"/ImageCalibSetting/","MainCalib");
            FrameManager.FrameManager.listImageCalibs.Add(ImageCalibHandeye);

        }
        private static bool FrameManager_openProject()
        {
           
            return true;
        }

        private static bool FrameManager_saveAsProject()
        {
            ImageCalibHandeye.Save();
            return true;
        }

        private static bool FrameManager_saveProject()
        {
            ImageCalibHandeye.Save();
            return true;
        }
        public static Form OpenMainCalibSettingForm()
        {
            FormMainCalibSetting frmSetting = new FormMainCalibSetting(ImageCalibHandeye);
            frmSetting.TopLevel = false;
            return frmSetting;
        }
    }
}
